import 'package:flutter/material.dart';

class VerticalListWidget extends StatelessWidget {
  List<String> _strList = ["横向列表", "网格列表", "多itemType的列表", "瀑布流"];

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("竖直列表"),
      ),
      body: new ListView.builder(
          itemCount: _strList.length,
          itemBuilder: (context, index) {
            return new GestureDetector(
              onTap: () {
                _handleTap(context, index);
              },
              child: new Container(
                padding: const EdgeInsets.all(10),
                child: new Text(_strList[index]),
              ),
            );
          }),
    );
  }

  ///处理点击事件
  void _handleTap(BuildContext context, int index) {
    if (index == 0) {
     /* Navigator.push(
          context,
          new MaterialPageRoute(
              builder: (context) => new HorizontalListView()));*/
    }
  }
}

class testAAA extends State{
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    throw UnimplementedError();
  }

  @override
  void didChangeDependencies() {
    // TODO: implement didChangeDependencies
    super.didChangeDependencies();
  }
  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }
}